package yifeng.spring.ioc;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		BeanDefinition bd;
		
		BeanFactory bf;
		
		ApplicationContext context = new ClassPathXmlApplicationContext("yifeng/spring/ioc/appcontext.xml");
		
		
		System.out.println(Main.class.getPackage());
		
		
		Hello hello = (Hello)context.getBean("hello");
		
		hello.sayHello();
		
//		ClassPathXmlApplicationContext context2 = new ClassPathXmlApplicationContext("yifeng/spring/ioc/appcontext.xml");
		
		System.out.println(context.getBeanDefinitionNames()[0]);
		System.out.println(context instanceof ListableBeanFactory);
		System.out.println(context.getType("hello"));
		System.out.println(context.getAliases("hello"));
		
//		System.out.println(context.getClass());
//		System.out.println(context.getId());
//		System.out.println(context.getDisplayName());
//		System.out.println(context.getAutowireCapableBeanFactory());
//		System.out.println(context.getStartupDate());
//		System.out.println(context.getParent());
//		
	}

}
